public class Solution1266 {
    public int minTimeToVisitAllPoints(int[][] points) {
        int ans=0;
        for (int i=1;i<points.length;i++){
            ans+=Math.max(Math.abs(points[i][1]-points[i-1][1]),Math.abs(points[i][0]-points[i-1][0]));
        }
        return ans;
    }

    public static void main(String[] args) {
        System.out.println(new Solution1266().minTimeToVisitAllPoints(new int[][]{{1,1},{3,4},{-1,0}}));
    }
}
